package model

import "errors"

var ErrNotFound = errors.New("Rows selectd is zero")
var ErrNotUpdated = errors.New("Rows affected by update is zero")
var ErrNotDeleted = errors.New("Rows affected by delete is zero")

var IsConstraintError = errors.New("Constraint failed")
var IsValidationError = errors.New("Validation failed")
var IsNotSingular = errors.New("Name is not singular")

type PromotionRuleGroupRel struct {
	Group      *PromotionRuleGroup `json:"group"`
	Rules      []*PromotionRule    `json:"rules"`
	DelRuleIds []uint64            `json:"delRuleIds"`
}

type PromotionActivityRel struct {
	Meta        []*PromotionActivityMetum          `json:"meta"`
	DelMetaIds  []uint64                           `json:"delMetaIds"`
	Media       []*PromotionAttachmentRelationship `json:"attachments"`
	DelMediaIds []uint64                           `json:"delMediaIds"`
	Blacklist   []string                           `json:"blacklist"`
	Groups      []*PromotionRuleGroupRel           `json:"groups"`
	DelGroupIds []uint64                           `json:"delGroupIds"`
}

type PromotionCouponRel struct {
	Meta        []*PromotionCouponMetum            `json:"meta"`
	DelMetaIds  []uint64                           `json:"delMetaIds"`
	Media       []*PromotionAttachmentRelationship `json:"attachments"`
	DelMediaIds []uint64                           `json:"delMediaIds"`
	Blacklist   []string                           `json:"blacklist"`
}

type PromotionActivityBindRel struct {
	Products       []*PromotionActivityProductRelationship         `json:"products"`
	DelSkuIds      []uint64                                        `json:"delSkuIds"`
	Brands         []*PromotionActivityProductBrandRelationship    `json:"brands"`
	DelBrandIds    []uint64                                        `json:"delBrandIds"`
	Categories     []*PromotionActivityProductCategoryRelationship `json:"categories"`
	DelCategoryIds []uint64                                        `json:"delCategoryIds"`
	Coupons        []*PromotionActivityCouponRelationship          `json:"coupon"`
	DelCouponIds   []uint64                                        `json:"delCouponIds"`
}

type PromotionCouponBindRel struct {
	Products       []*PromotionCouponProductRelationship         `json:"products"`
	DelSkuIds      []uint64                                      `json:"delSkuIds"`
	Brands         []*PromotionCouponProductBrandRelationship    `json:"brands"`
	DelBrandIds    []uint64                                      `json:"delBrandIds"`
	Categories     []*PromotionCouponProductCategoryRelationship `json:"categories"`
	DelCategoryIds []uint64                                      `json:"delCategoryIds"`
}
